var that,
  api = new (require('../../utils/api.js')),
  headimg = api.getimgurl(), 
  app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tab:0,
    benefit:'+0.00',
    win:'800.00',
    kui:'20',
    zuowin:'800.00',
    b_tpyl:'3222.88',
    yfdy:'2212.22',
    msjy:'2423.33',
    axxr:'0'
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    that = this
    let {settings} =  app.logininfo,{yfdyloss,pensionloss,profit,cumulativerevenue,erevenue,loss,pension,yfdy,msjy} = settings;
    that.setData({profit,erevenue,yfdyloss,pension,yfdy,msjy,loss,cumulativerevenue,pensionloss})

    let{win,kui} = this.data,b=win-kui ;

this.setData({benefit:(b>0?'+':'-')+b+'元'})
  },

  tab(e){
    this.setData({tab:e.currentTarget.dataset.id})
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})